n=input()
nums=list(map(int,input().split()))

result=1
for i in range(1,len(nums)):
    if nums[i]!=nums[i-1]:
        result+=1
print(result)
